Textarea> inside handles as expected in Chrome but not Firefox?

Up vote 0 down vote favorite share g+ share fb share tw.

I'm creating a textarea inside a foreignObject in an SVG as follows: var doc = document. GetElementById("cover"); var foreign = document. CreateElementNS(svgNS,"foreignObject"); var textarea = document.

CreateElementNS("w3.org/1999/xhtml","textarea"); foreign. SetAttributeNS(null,"x",40); foreign. SetAttributeNS(null,"y",40); foreign.

SetAttributeNS(null,"width",500); foreign. SetAttributeNS(null,"height",200); doc. AppendChild(foreign); textarea.

SetAttributeNS(null,"xmlns","w3.org/2000/xmlns/"); textarea. TextContent = "Text goes here. "; foreign.

AppendChild(textarea); This works fine in Chrome. However, in Firefox, I can't see the textarea at all. When I check with Firebug, it does exist, but firefox has forced static positioning on it, and depending on how I scroll, the highlighted box from hovering over the object in the html tab isn't necessarily even inside the svg.

Even when it is, I can't see the textarea. What can I do to fix this in Firefox? For reference, I'm using the newest versions of both browsers (updated a few hours ago).

Javascript firefox google-chrome svg textarea link|improve this question asked Oct 25 '11 at 7:45Fibericon290112 93% accept rate.

Works for me if I change this line: textarea. SetAttributeNS(null,"xmlns","w3.org/2000/xmlns/" rel="nofollow">w3.org/2000/xmlns/"" rel="nofollow">w3.org/2000/xmlns/"); To this: textarea. SetAttributeNS("w3.org/2000/xmlns/" rel="nofollow">w3.org/2000/xmlns/"" rel="nofollow">w3.org/2000/xmlns/","xmlns","w3.org/2000/xmlns/" rel="nofollow">w3.org/2000/xmlns/"" rel="nofollow">w3.org/2000/xmlns/"); I think Firefox is just being more strict about the namespaces.

It could be a bug, but this indicates it's accepted to require the w3.org/2000/xmlns/" rel="nofollow">w3.org/2000/xmlns/ for DOM processing: The prefix xmlns: was specified as a syntactic device for declaring namespaces, but was not itself associated with any namespace name by the Jan 1999 namespaces specfication. But in some processing contexts, e.g. DOM, it is useful to represent all XML attributes as (namespace name, local name) pairs. For this purpose, the namespace name w3.org/2000/xmlns/" rel="nofollow">w3.org/2000/xmlns/ is assigned.

That works for firefox. Any idea how to make it work for IE, or is that a whole other can of worms? – Fibericon Oct 26 '11 at 2:44 1 @Fibericon IE only started supporting SVG in version 9 and support is well behind the other major browsers.

For older versions you could try svgweb but I think that native support is the only real option if you're going to use foreignObject. – robertc Oct 26 '11 at 7:46.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions